package edu.wit.system.domain.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import edu.wit.common.utils.StringUtils;
import edu.wit.system.utils.UserUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
//import org.springframework.security.core.context.SecurityContextHolder;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 *
 *
 * @author yyh
 * @email 664287382@qq.com
 * @date 2021-05-26 11:45:36
 */
@Getter
@Setter
@ApiModel(value = "返回类")
public class AffairsApplyWrokflowNodeDto implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 *
	 */
	@JsonSerialize(using=ToStringSerializer.class)
	@ApiModelProperty(value = "申请节点ID")
	private Long applyNodeId;
	/**
	 *
	 */
	@ApiModelProperty(value = "申请节点名称")
	private String workflowNodeName;
	/**
	 *
	 */
	@JsonSerialize(using=ToStringSerializer.class)
	@ApiModelProperty(value = "申请节点顺序")
	private Long workflowNodeIndex;
	/**
	 *
	 */
	@JsonSerialize(using=ToStringSerializer.class)
	@ApiModelProperty(value = "申请ID")
	private Long applyId;
	/**
	 *
	 */
	@ApiModelProperty(value = "申请节点状态(1:待审核,2:已通过,3:未通过)")
	private String workflowNodeStatus;
	/**
	 *
	 */
	@ApiModelProperty(value = "申请节点是否为当前节点(0:否,1:是)")
	private String workflowNodeIscurrent;
	/**
	 *
	 */
	@JsonSerialize(using=ToStringSerializer.class)
	@ApiModelProperty(value = "审核人ID")
	private Long examineUserId;
	/**
	 *
	 */
	@ApiModelProperty(value = "审核人姓名")
	private String examineUserName;
	/**
	 *
	 */
	@ApiModelProperty(value = "审核时间")
	private Date examineTime;

	/**
	 *
	 */
	@ApiModelProperty(value = "不通过原因")
	private String examineReason;

	public String getExamineUserName() {
		if(StringUtils.isNotNull(getExamineUserId())) {
			setExamineUserName(UserUtils.selectNameByUserId(getExamineUserId()));
		}
		return examineUserName;
	}

	private List<AffairsApplyWorkflowNodeUserDto> workflowNodeUserList;

}

